home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / dalla rivista / shapeshifter / hardfile / utility.ss / MacZip 1.01 final.sit / MacZip 1.01 final / docs / README.TXT < prev    next >
Text File  |  1999-01-28  |  21KB  |  512 lines

  1. Macintosh Port of Info-Zip's Zip
  2. by Dirk Haase, d_haase@sitec.net
  3. homepage:   www.sitec.net/maczip
  4. 15. January 1999
  5. ================================
  6.  
  7.  
  8. Some notes about this port:
  9. ===========================
  10.  
  11. MacZip requires at least System 7 and a Macintosh with a minimum of a 
  12. Motorola 68020 or PowerPC 601 processor. Other configurations may work
  13. but it is not tested at all.
  14.  
  15. The application is distributed as a fat binary with both regular 68K 
  16. and native PowerPC versions included.
  17.  
  18. Move the executable(s) somewhere--for example, drag it (or them) to your
  19. Applications folder.  For easy access, make an alias in the Launcher Control
  20. Panel or directly on your desktop.
  21. The GUI is very simple. It was not my intention to make a full-blown GUI,
  22. however I think it is comfortable enough to use it as regular tool.
  23.  
  24. This port supports also Apple-event.So you can install it in your
  25. WWW-Browser as a helper-app.
  26.  
  27. For more Info about the contents of this package, take a look into
  28. the "macos/Contents" (or :macos:Contents) file. Some notes on how to
  29. rebuild the Macintosh applications can be found in INSTALL.
  30.  
  31.  
  32.  
  33. Usage:
  34. ------
  35.  
  36. Basically there are four ways to start MacZip:
  37.  
  38. a) Drag'n Drop
  39.    To extract an archive drop an archive on MacZip.
  40.    To compress files drop a file, folder or volume on MacZip.
  41.    Note: You can not drop more than one item at the same time.
  42.    
  43.    
  44.  
  45. b) using the Dialog box (Menu: File->Start Zip/Unzip):
  46.    - Go to "Current App" and select "Zip" or "Unzip".
  47.    - Go to "File>Start Zip/Unzip"and the "Zip/Unzip Options" Dialog Box appears.
  48.    - Click on "Zip Archive"
  49.    - The "Select an archive" dialog box appears
  50.      You have basically two choices:
  51.         * Extraction:
  52.         a) select a existing zip archive
  53.            -> The choosen archive will be extracted.
  54.         * Compression:
  55.         a) select a existing zip archive
  56.            -> Your files will be added to that zip archive.
  57.         b) select a folder and name your new zip archive
  58.            -> a new zip archive will be created with your files.
  59.    - Select one or more check boxes if you want.
  60.    - Click on "Start Zip/Unzip" to start the task.
  61.      
  62.      
  63.      
  64. c) Using the Commandline (Menu: File->Command Line):
  65.    The zip & unzip tools are command line tools. So the behavior is exactly 
  66.    the same like the zip & unzip tools on unix or win. This means if you 
  67.    want zip some files you have to write a command line like this: 
  68.    "zip [switches] path_to_zip_archive path_to_files_folders"
  69.    
  70.    - Go to "File" and select "Command Line" and the "MacZip Entry box" 
  71.      Dialog Box appears.
  72.  
  73.    An example:
  74.  
  75.    a: your zip may be created at
  76.            Macintosh HD:applications:archive.zip
  77.  
  78.    b: your files may be found at
  79.            Macintosh HD:somewhere:my_folder_to_archive:*
  80.  
  81.    Note: At the end of the path there must be a filename or a wild card !
  82.    (Footnote: 1 wild card, 2 Mac pathnames)
  83.    
  84.    So the command line should look like (one line!):
  85.  
  86.    zip "Macintosh HD:applications:archive.zip" "Macintosh HD:somewhere:my_folder_to_archive:*"
  87.    
  88.    - Click on "Enter" to start the task.
  89.  
  90.    Since you can not set a default folder you have to enter always a 
  91.    full qualified path names. Full qualified path names are path names 
  92.    including the Volume name ! (Footnote: 2 Mac pathnames)
  93.      
  94.      
  95.      
  96. d) Using Applescript:
  97.  
  98. There is only one additional event defined: "do_cmd". You can enter 
  99. every valid command line. The first word must be "zip" or "unzip" to
  100. select the action (compress or extraction).
  101.  
  102. See sample Applescript:
  103.  
  104.         tell application "MacZip (PPC)"
  105.             activate
  106.             with timeout of 90000 seconds
  107.                 do_cmd "zip -rjjN Volume:archive \"My Volume:*\" "
  108.             end timeout
  109.         end tell
  110.  
  111. This script opens MacZip, brings it to the foreground on the Mac, starts the zip 
  112. action with the command line: zip -rjjN Volume:archive "My Volume:*" .
  113.  
  114.  
  115.  
  116.  
  117. A short introduction is also available online:
  118. http://www.sitec.net/maczip/How-To-Do/  
  119.  
  120. It's possible to stop the run of Zip/Unzip with the well
  121. known shortcut [Command] + [.].
  122.  
  123.  
  124. ---------------------------------------------------------------------------
  125.  
  126. There are some Mac-specific switches available.
  127. Zip Module:
  128.        -df    [MacOS   only]  Include  only  data-fork  of  files
  129.               zipped into the archive.  Good for exporting  files
  130.               to  foreign operating-systems.  Resource-forks will
  131.               be ignored at all.
  132.  
  133.        -jj    [MacOS  only] record Fullpath (+ Volname). The com-
  134.               plete  path  including  volume  will  be stored. By
  135.               default the relative path will be stored.
  136.  
  137.        -S     Include system and hidden  files.  This  option  is
  138.               effective  on  some  systems only; it is ignored on
  139.               Unix.  On MacOS, this option includes finder invis-
  140.               ible files, which are ignored otherwise.
  141.  
  142. Unzip Module:
  143.        -E     [MacOS only] display contents of MacOS extra  field
  144.               during restore operation.
  145.  
  146.        -i     [MacOS only] ignore filenames stored in MacOS extra
  147.               fields.  Instead,  the  most  compatible   filename
  148.               stored in the generic part of the entry's header is
  149.               used.
  150.  
  151.        -J     [MacOS only] ignore MacOS extra fields.  All Macin-
  152.               tosh  specific  info  is  skipped.  Data-fork   and
  153.               resource-fork are restored as separate files.
  154.  
  155.  
  156. Select [File]->[Get Help on Zip/Unzip] for a complete list 
  157. of switches.
  158.  
  159.  
  160.  
  161. Limitations / Problems:
  162. -----------------------
  163.  
  164.     - Aliases are not supported. I tried, but I got broken aliases
  165.       This port will silently ignore all aliases.
  166.       It's on my to-do list for future releases.
  167.  
  168.     - Zip needs much memory to compress many files:
  169.       You may need to increase the 'Preferred Size' in 'Get Info'.
  170.       Values of 12 Megabytes or more are possible
  171.  
  172.     - Unzip needs about 500 Kbyte of memory to unzip no matter
  173.       how many files were compressed and expanded.
  174.  
  175.     - and finally one big macintosh-related problem:
  176.       This port has one weak point: It's based on pathnames.
  177.       As you may be already know: Pathnames are not unique on a Mac !
  178.       The main reason is that an attempt to implement support exact saving of
  179.       the MacOS specific internal file-structures would require a throughout
  180.       rewrite of major parts of shared code, probably sacrifying compatibility
  181.       with other systems.
  182.       I have no solution at the moment. The port will just warn you if you try
  183.       zip from / to a volume which has a duplicate name.
  184.       MacZip has problems to find the archive or the files.
  185.       My (Big) recommendation: Name all your volumes with a unique name and
  186.       MacZip will run without any problem.
  187.  
  188.  
  189. Known Bugs:
  190.  
  191.     - crypted files in a zip archive are sometimes corrupt:
  192.       I get an error message: invalid compressed data to inflate.
  193.       Appearance of this error is purly be change:
  194.       I did a small test: Unzipping an archive containing 3589 files
  195.       56 files fails to unzip, so about 1.5%.
  196.       Rootcause is completly unclear to me :(
  197.       
  198. I strongly recommend to test your archive (eg. unzip -t archive).
  199.  
  200.  
  201.  
  202.  
  203. Zip-Programs / Macintosh Extra-Data:
  204. -----------------------------------------
  205. A brief overview:
  206. Currently, as far as I know, there are 4 Zip-Programs available 
  207. for the Macintosh platform.
  208. These programs build (of cause) different variants of Zip-Files:
  209.  
  210.     - Info-Zip's first Port of Zip. Ported by Johnny Lee
  211.       This Port is rather outdated and no longer supported (since 1992).
  212.       68K only. Only minimal Mac-info is stored (Creator/Type,
  213.       Finderattributes). Creator/Type: '????' / '????'
  214.       Until year 1998, Only Unzip 5.32 survived.
  215.  
  216.     - ZipIt by Tom Brown. This is Shareware and still supported I think.
  217.       ZipIt has a nice GUI, but I found it can't handle large Zipfiles
  218.       quite well. ZipIt compresses Macintosh files using the MacBinary
  219.       format. So, transfering files to other platforms is not so easy.
  220.       Only minimal Mac-info is stored (Creator/Type, Finderattributes).
  221.       Macfilenames are changed to a most compatible filename.
  222.       Creator/Type: 'ZIP ' / 'ZIP '
  223.  
  224.     - PKZIP/mac v2.03/210d. This is Shareware.
  225.       This Zip implementation for the Mac can be found on ASI's website
  226.       (http://www.asizip.com/products/products.htm).  The name of this
  227.       program is misleading, it is NOT a product from PKWARE.  ASI last
  228.       release version is v2.03, and they also offer a newer beta version
  229.       PKZIP/mac 210d. But even the Beta version is rather outdated (1995).
  230.       Only minimal Mac-info is stored (Creator/Type, Finderattributes).
  231.       The Zipfile format looks like incompatible to other platforms.
  232.       (More details about the compatibility issue can be found in
  233.       proginfo/3rdparty.bug!). Type: 'PKz1'
  234.       Macfilenames are restored without any change.
  235.  
  236. and finally:
  237.     - Info-Zip's latest Port of Zip. MacZip 1.0. Ported by me :-)
  238.       It is supported (of cause) and up to date. Fullset of macintosh
  239.       info is stored: Creator/Type, Finderattributes, Findercomments,
  240.       MacOS 8.0 Foldersettings, Icon/Folder-Positions ...
  241.       Macfilenames are restored without any change.
  242.       Creator/Type: 'IZip' / 'ZIP '
  243.       
  244.  
  245. Compatibility of my port; Extraction:
  246.    - Archives from Info-Zip's first port (by Johnny Lee) are still compatible.
  247.    - Extraction of ZipIt archives are supported. This support is not 
  248.      complete: Filenames are korrect but Directory names are sometimes mangled
  249.      to a dos compatible form. Segmented archives are not supported.
  250.    - PKZiP/mac archives-files are extracted without resource-forks
  251.      and without any Finderinfo. I have no information about that zip-format.
  252.  
  253. Compatibility of my port; Compression:
  254.    - My port supports only the new Info-Zip format
  255.      (introduced with this port). Therefore archives created by MacZip 1.0
  256.      (1999) must be extracted with this version or later releases of Info-ZIP's
  257.      UnZip to restore the complete set of Macintosh attributes.
  258.  
  259. Note: This port is complete unrelated to the shareware ZipIt. Even more,
  260. handling of special Macintosh attributes is incompatible with ZipIt.
  261. This port (MacZip) may be used to extract archives created by ZipIt,
  262. but make sure that you get the result as you expected.
  263.  
  264.  
  265.  
  266. Macintosh Files; File Forks:
  267. ----------------------------
  268.  
  269. All Macintosh files comprise two forks, known as the data fork and the
  270. resource fork.  Unlike the bytes stored in the resource fork, the bytes in
  271. the data fork do not have to exhibit any particular internal structure.
  272. The application is responsible for interpreting the bytes in the data fork
  273. in whatever manner is appropriate. The bytes in the resource fork usually
  274. have a defined internal structure and contain data object like menus,
  275. dialog-boxes, icons and pictures.
  276. Although all Macintosh files contain both a data fork and a resource fork,
  277. one or both of these forks may be empty.
  278.  
  279. MacZip stores data-forks and resource-forks separatly. The Zipfile-Format
  280. does not allow to store two archive entries using exactly the same name.
  281. My solution is to modify the Pathname of the resource-fork. All resource-fork
  282. names are prepended with a leading special directory named "XtraStuf.mac".
  283. So, when extracting on a Mac, you should never see this directory
  284. "XtraStuf.mac" on your *disk*.
  285.  
  286. On all foreign systems that support directories in filenames (e.g: OS/2, Unix,
  287. DOS/Windows, VMS) you will get a directory "XtraStuf.mac" when extracting
  288. MacZip archives.
  289. You can delete the complete directory "XtraStuf.mac" since Mac-resources
  290. do not make much sense outside the MacOS world.
  291.  
  292.  
  293.  
  294. Textencoding; Charsets of the Filenames:
  295. ----------------------------------------
  296.  
  297. The following information is only important if you plan to transfer
  298. archives across different platforms/language systems:
  299.  
  300. A typical Zip-archive does not support different charsets. All filenames
  301. stored in the public area (= accessible by foreign systems other
  302. than MacOS) must be coded in the charset ISO-8859-1 (CP1252 in the Microsoft
  303. Windows world) or CP850 (DOSLatin1). The latter should only be used by
  304. Zip programs that mark the archive entries as "created under DOS".
  305. Apart from Macs, the commonly used platforms either support ISO-8859-1
  306. directly, or are compatible with it.
  307. To achieve maximum compatibility, MacZip convert filenames from the
  308. Mac OS Roman character set to ISO-8859-1 and vice versa.
  309. But not every char of the charset MacRoman has their equivalent
  310. in ISO-8859-1. To make the mapping in most cases possible, I chose
  311. most similar chars or at least the MIDDLE DOT. 
  312.  
  313. Mac OS Roman character set is used for at least the following Mac OS
  314. localizations:
  315. U.S., British, Canadian French, French, Swiss French,
  316. German, Swiss German, Italian, Swiss Italian, Dutch,
  317. Swedish, Norwegian, Danish, Finnish, Spanish, Catalan,
  318. Portuguese, Brazilian, and the default International system.
  319.  
  320. In all Mac OS encodings, character codes 0x00-0x7F are identical to
  321. ASCII, except that
  322.   - in Mac OS Japanese, yen sign replaces reverse solidus
  323.   - in Mac OS Arabic, Farsi, and Hebrew, some of the punctuation in this
  324.     range is treated as having strong left-right directionality,
  325.     although the corresponding Unicode characters have neutral
  326.     directionality
  327. So, for best compatibility, confine filenames to the standard
  328. 7-bit ASCII character set.
  329.  
  330. If you generate a filename list of your archive (unzip -l), you will
  331. see the converted filenames. Your can also extract the archive with
  332. the switch '-i' (= ignore mac filenames), and test your result.
  333.  
  334. This MacZip-port uses its own filename stored in the archive.
  335. At the moment, the filename will be not converted. However,
  336. I'm planning to add support for unicode.
  337.  
  338. Currently, the following Mac OS encodings are NOT supported:
  339. Japanese, ChineseTrad, Korean, Arabic, Hebrew, Greek, Cyrillic,
  340. Devanagari, Gurmukhi, Gujarati, Oriya, Bengali, Tamil, Telugu
  341. Kannada, Malayalam, Sinhalese, Burmese, Khmer, Thai, Laotian,
  342. Georgian, Armenian, ChineseSimp, Tibetan, Mongolian, Ethiopic,
  343. Vietnamese, ExtArabic and finally:
  344. Symbol - this is the encoding for the font named "Symbol". 
  345. Dingbats - this is the encoding for the font named "Zapf Dingbats".
  346. If you extract an archive coded with one of these charsets
  347. you will propably get filenames with funny characters. 
  348.  
  349. These problems apply only to filenames and NOT to the file
  350. content.
  351. Of cause: The content of the files will NEVER be converted !!
  352.  
  353.  
  354.  
  355. File-/Creator Type:
  356. -------------
  357.  
  358. This port uses the creator type 'IZip' and it is registered at Apple
  359. (since 08. March 1998). File types can not be registered any more.
  360. This port uses 'ZIP ' for Zip archive files.
  361. The creator 'IZip' type should be used for all future versions.
  362.  
  363.  
  364.  
  365. Hints for proper restoration of filetime stamps:
  366. ------------------------------------------------
  367.  
  368. UnZip requires the host computer to have proper timezone information in
  369. order to handle certain tasks correctly (see unzip.doc).  To set the
  370. timezone on the Macintosh, go to the Map Control Panel and enter the
  371. correct number of hours (and, in a few locales, minutes) offset from
  372. Universal Time/Greenwich Mean Time.  For example, the US Pacific timezone
  373. is -8 hours from UTC/GMT during standard (winter) time and -7 hours from
  374. UTC/GMT during Daylight Savings Time.  The US Eastern timezone is -5 hours
  375. during the winter and -4 hours during the summer.
  376.  
  377. Discussion of Daylight Savings Time
  378. -----------------------------------
  379. The setting in the Date & Time control panel for Daylight Savings time 
  380. is a universal setting. That is, it assumes everybody in the world is 
  381. observing Daylight Savings time when its checkbox is selected.
  382.  
  383. If other areas of the world are not observing Daylight Savings time when 
  384. the checkbox is selected in the Date & Time control panel, then the Map 
  385. control panel will be off by an hour for all areas that are not recognizing
  386. Daylight Savings time.
  387.  
  388. Conversely, if you set the Map control panel to an area that does not observe
  389. Daylight Savings time and deselect/uncheck the checkbox for Daylight Savings 
  390. time in the Date & Time control panel, then time in all areas celebrating 
  391. Daylight Savings time will be off by an hour in the Map control panel.
  392.  
  393. Example:
  394.      In the case of Hawaiians, sometimes they are three hours
  395.      behind Pacific Standard Time (PST) and sometimes two hours
  396.      behind Pacific Daylight Time (PDT). The Map control panel
  397.      can only calculate differences between time zones relative
  398.      to Greenwich Mean Time (GMT). Hawaii will always show up as
  399.      three hours past the Pacific time zone and five hours past
  400.      the Central time zone.
  401.  
  402.      When Hawaiians are not observing Daylight Savings time, but
  403.      the rest of the country is, there is no combination of
  404.      settings in Map and Date & Time control panels which will
  405.      enable you to display Hawaiian local time correctly AND
  406.      concurrently display the correct time in other places that
  407.      do observe Daylight Savings time.
  408.  
  409.      The knowledge about which countries observe Daylight Savings
  410.      time and which do not is not built into the Map control
  411.      panel, so it does not allow for such a complex calculation.
  412.  
  413.      This same situation also occurs in other parts of the world
  414.      besides Hawaii. Phoenix, Arizona is an example of an area of
  415.      the U.S. which also does not observe Daylight Savings time.
  416.  
  417. Conclusion:
  418. MacZip only know the GMT and DST offsets for the current time, not 
  419. for the time in question.
  420.  
  421.  
  422. Projects & Packages:
  423. --------------------
  424.  
  425. A Note to version numbers: Version of MacZip is currently 1.00 and
  426. is based on the zip-code version 2.3 and unzip-code version 5.4.
  427. See About-Box for current version and compiler build-date.
  428.  
  429. Because of the amount of sources I splitted this port into
  430. serveral projects. See http://www.sitec.net/maczip for updates.
  431.  
  432. - core source parts:
  433.     unzxxx.zip
  434.     zipxxx.zip
  435.       These archives contains the main-parts of the port. You can build
  436.       libraries and a standalone-App with Metrowerks standard console SIOUX.
  437.       They contain only sources, no executables.
  438.       These archives are exact copies of the standard Info-ZIP source
  439.       distributions; they were only repacked under MacOS using MacZip,
  440.       with one minor addition: For those files that are stored in BinHex'ed
  441.       format in the Info-ZIP reference source archives, unpacked version
  442.       that are ready for use have been added.
  443.  
  444. - additional source part:
  445.     MacZipxxx.zip: contains all the GUI-staff and the project-files to
  446.       build the main-app.  Only sources of the GUI, no zip- or unzip-code.
  447.       To build MacZip successfully you will need to also download the zip-
  448.       and unzip-packages.
  449.  
  450. - executables:
  451.     MacZipxxxnc.hqx: contains only executables and some docs,
  452.                       version without en-/decryption support
  453.     MacZipxxxc.hqx:  contains only executables and some docs, Crypt version
  454.  
  455. - encryption sources:
  456.     zcryptxx.zip: To build crypt-versions of MacZip.
  457.     download from ftp://ftp.icce.rug.nl/infozip/ (and subdirectories)
  458.  
  459.  
  460.  
  461. Credits:
  462. --------
  463.  
  464. Macstuff.c and recurse.c: All the functions are from More Files.
  465. More Files fixes many of the broken or underfunctional
  466. parts of the file system. Thanks to Jim Luther.
  467. (see morefiles.doc)
  468.  
  469. MatWild.c: Originally C++ code written by JJS (jstrout@ucsd.edu).
  470.  
  471.  
  472.  
  473. ---------------------------------------------------------------------------
  474. Footnotes:
  475.  
  476. 1. wild card:      
  477.     The '*' is a wild card and means 'all files'
  478.     Just in case you don't know wild cards:
  479.     '*' is a place holder for any character.
  480.     e.g.: 
  481.     "this*" matches with "this_file" or  "this_textfile" but it
  482.     don't matches with "only_this_file" or  "first_this_textfile"
  483.     "*this*" matches with "this_file" or  "this_textfile" AND
  484.     matches with "only_this_file" or  "first_this_textfile"
  485.  
  486.  
  487. 2. Mac pathnames:
  488. The following characteristics of Macintosh pathnames should be noted:
  489.  
  490.     A full pathname never begins with a colon, but must contain at 
  491.     least one colon. 
  492.     A partial pathname always begins with a colon separator except in 
  493.     the case where the file partial pathname is a simple file or 
  494.     directory name. 
  495.     Single trailing separator colons in full or partial pathnames are 
  496.     ignored except in the case of full pathnames to volumes. 
  497.     In full pathnames to volumes, the trailing separator colon is required. 
  498.     Consecutive separator colons can be used to ascend a level from a 
  499.     directory to its parent directory. Two consecutive separator colons 
  500.     will ascend one level, three consecutive separator colons will ascend 
  501.     two levels, and so on. Ascending can only occur from a directory; 
  502.     not a file. 
  503.  
  504.  
  505.  
  506.  
  507.  
  508. ---------------------------------------------------------------------------
  509.  
  510. Dirk Haase
  511. ==========
  512.